import Filter from "@module/Filter";
import urlHook from "@page/common/utils/urlHook";


export default function BidProInfo(props) {
    const {name,brandName,sn,unit,productPrice,brand,price,code}=props.bid||{};
    let _price=productPrice?productPrice:price

    return(
        <div>
            <div className={'bid-info-table'}>

                <div className={'zen_flex'}>
                    <span className={'bid-info-row-name'}>商品名称</span>
                    <span className={'bid-info-row-val'}>{name}</span>
                </div>

                <div className={'zen_flex'}>
                    <span className={'bid-info-row-name'}>商品品牌</span>
                    <span className={'bid-info-row-val'}>{brandName||brand||'无'}</span>
                </div>

                <div className={'zen_flex'}>
                    <span className={'bid-info-row-name'}>商品货号</span>
                    <span className={'bid-info-row-val'}>{code}</span>
                </div>

                <div className={'zen_flex'}>
                    <span className={'bid-info-row-name'}>商品单位</span>
                    <span className={'bid-info-row-val'}>{unit||'-'}</span>
                </div>

                <div className={'zen_flex'}>
                    <span className={'bid-info-row-name'}>商品销售价</span>
                    <span className={'bid-info-row-val'}>{Filter.float(_price,2)}</span>
                </div>
            </div>
            <div className={'zen_flex zen_m-t-20 '}>
                <div
                    onClick={props.onClick}
                    className="bid-inputbid-upload">更换商品</div>
                <div
                    onClick={()=>{
                        const proId=$state.params.id
                        window.open(urlHook.suppAddProduct(proId))
                    }}
                    className={'bid-bidinput-modal-btn2'}>
                    新增商品
                </div>
            </div>
        </div>

    )
}